Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bloodline

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bloodline

Proper inheritance in JavaScript

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.2K
decreased by-30.41%
Maintainers
1
Weekly downloads
 
Created
Source

Bloodline

npm npm license npm downloads build status

Proper inheritance in JavaScript

Install via npm

$ npm install --save bloodline

Usage

var inherit = require( 'bloodline' )
inherit( Constructor, SuperConstructor )

Notes

ES6 / ES2015 / ESNext

ES6 classes cannot be subclassed by ES5 classes (ES5 classes cannot inherit from ES6 classes); there will be a TypeError: Class constructor SuperConstructor cannot be invoked without 'new'. This is not a limitation of this module, but of the ECMAScript specification.

The other way around also has issues; ES6 classes don't preserve the prototype chain when extending ES5 classes (for an example, see https://gist.github.com/jhermsmeier/e6fb16fab193c0aa4220c98de64fe546).

So much for backwards compatibility.

util.inherits

Usage of Node core's of util.inherits() is discouraged (see nodejs.org/api/util#util_inherits), because of its semantic incompatibility. NOTE: This module does not exhibit these semantic incompatibilities.

Keywords

FAQs

Package last updated on 31 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc